home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / IOInterface / commonDef.dcl next >
Encoding:
Modula Definition  |  1997-04-23  |  2.5 KB  |  89 lines  |  [TEXT/3PRM]

  1. definition module commonDef;
  2.  
  3. //    Version 0.8 to 1.0.
  4.  
  5. //
  6. //    Common types for the event I/O system:
  7. //
  8.  
  9. from StdString import String;
  10.  
  11. from    mac_types        import Rect, WindowPtr, Toolbox;
  12. from    deltaPicture    import Rectangle, Point;
  13.  
  14. ::    ItemTitle        :==    String;
  15.  
  16. ::    SelectState        =    Able | Unable;
  17. ::    MarkState        =    Mark | NoMark;
  18.  
  19. ::    KeyboardState    :==    (!KeyCode, !KeyState, !Modifiers);
  20. ::    KeyCode            :==    Char;
  21. ::    KeyState        =    KeyUp | KeyDown | KeyStillDown;
  22.  
  23. ::    MouseState        :==    (!MousePosition, !ButtonState, !Modifiers);
  24. ::    MousePosition    :==    (!Int, !Int);
  25. ::    ButtonState     =    ButtonUp | ButtonDown
  26.                     |    ButtonDoubleDown | ButtonTripleDown | ButtonStillDown;
  27.  
  28. /*    Modifiers indicates the meta keys that have been pressed (True) or
  29.     not (False): (Shift, Option, Command, Control)
  30. */
  31.  
  32. ::    Modifiers        :==    (!Bool, !Bool, !Bool, !Bool);
  33.  
  34. ::    PictureDomain    :==    Rectangle;
  35.  
  36.  
  37. ::    Cond x            :== x -> Bool;
  38.  
  39.  
  40. SelectStateEqual    :: !SelectState    !SelectState    -> Bool;
  41. MarkEqual            :: !MarkState    !MarkState        -> Bool;
  42. ButtonStateEqual    :: !ButtonState    !ButtonState    -> Bool;
  43. Enabled                ::                !SelectState    -> Bool;
  44. Checked                ::                !MarkState        -> Bool;
  45. MarkSwitch            ::                !MarkState        -> MarkState;
  46. KeyMapToModifiers    :: !(!Int,!Int,!Int,!Int)        -> Modifiers;
  47. INTToModifiers        ::                !Int            -> Modifiers;
  48. ModifiersToINT        ::                !Modifiers        -> Int;
  49.  
  50. InGrafport            :: !WindowPtr !(Toolbox -> (x, Toolbox))    !Toolbox -> (!x, !Toolbox);
  51. InGrafport2         :: !WindowPtr !(Toolbox -> Toolbox)            !Toolbox -> Toolbox;
  52.  
  53. LocalToGlobal        :: !Point !Toolbox            -> (!Point,!Toolbox);
  54. GlobalToLocal        :: !Point !Toolbox            -> (!Point,!Toolbox);
  55.  
  56. If                    :: !Bool x x                -> x;
  57.  
  58. ABS                    :: !Int                        -> Int;
  59. Dist                :: !Int !Int                -> Int;
  60. Min                    :: !Int !Int                -> Int;
  61. Max                    :: !Int !Int                -> Int;
  62. SetBetween            :: !Int !Int !Int            -> Int;
  63. IsBetween            :: !Int !Int !Int            -> Bool;
  64.  
  65. ABSR                :: !Real                    -> Real;
  66.  
  67. RectangleToRect        :: !Rectangle                -> Rect;
  68. IsEmptyRect            :: !Rect                    -> Bool;
  69.  
  70. Head                :: ![x]                        -> x;
  71. Tail                :: ![x]                        -> [x];
  72. IsEmptyList            :: ![x]                        -> Bool;
  73. Reverse                :: ![x]  [x]                -> [x];
  74. Concat                :: ![x] ![x]                -> [x];
  75. Map                    :: !(x -> y) ![x]            -> [y];
  76. StateMap            :: !(x -> .s -> (y, .s)) ![x] .s    -> (![y], .s);
  77. StateMap2            :: !(x -> .s -> .s)         ![x] !.s    -> .s;
  78. Remove                :: !(Cond x) x ![x]                    -> (!Bool, x, ![x]);
  79. Append                :: ![.x] !.x                        -> [.x];
  80. Length_new            :: ![x]                        -> Int;
  81.  
  82. RemoveCheckInt        :: ![Int] !Int -> (!Bool, ![Int]);
  83. ContainsInt            :: ![Int] !Int -> Bool;
  84.  
  85. RemoveChar            :: ![Char] !Char -> [Char];
  86. ContainsChar        :: ![Char] !Char -> Bool;
  87.  
  88. Error                :: !String !String !String    -> .x;
  89.